package com.springboot.mapper;

import com.springboot.domain.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserDao {

    public List<User> findUsers(User u);

    List<User> findUser2();
    List<User> findUser3();


    @Insert("insert into ssm_user(login_name,user_name,password,birthday) " +
            "values " +
            "(#{loginName},#{userName},#{password},current_date())")
    //年月日  current_date()  时分秒 current_time()/curdate()  年月日时分秒  current_timetamp()/now()
    int addUser(User u);

    @Update("update ssm_user set user_name = #{userName} where id = ${id}")
    int editUser(User u);

    @Delete("delete from ssm_user where id = ${id}")
    int removeUser(@Param(value = "id") int id);

}
